import java.util.Scanner;

public class code4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        String b = sc.next();
        int sum = 20;
        if (a>1) {
            sum+=(int) Math.ceil(a-1);//向上取整
        }

        if (b.equals("y")) sum+=5;
        System.out.println(sum);
    }
}
